<% add_decidim_meta_tags(
  title: present(meeting).title,
  description: present(meeting).description,
  url: meeting_url(meeting.id),
  resource: meeting) %>

<%= append_javascript_pack_tag "decidim_meetings" %>
<%= append_stylesheet_pack_tag "decidim_meetings" %>
<%= append_javascript_pack_tag "decidim_forms" %>

<% add_body_classes "meeting-poll__layout" %>

<%= render layout: "layouts/decidim/shared/layout_center" do %>
  <div class="meeting-polls__topbar">
    <%= link_to meeting_path(meeting), class: "button button__sm button__text-secondary" do %>
      <%= icon "arrow-left-line" %>
      <%= t("back_to_meeting", scope: "decidim.meetings.polls.responses.index_admin") %>
    <% end %>

    <% if admin_allowed_to?(:update, :poll, meeting: meeting, poll: poll) %>
      <%= link_to admin_meeting_polls_responses_path(meeting), class: "button button__sm button__primary" do %>
        <%= t("administrate", scope: "decidim.meetings.polls.responses.index") %>
      <% end %>
    <% end %>
  </div>

  <div class="text-center">
    <h1 class="title-decorator inline-block text-left">
      <%= t("title", scope: "decidim.meetings.polls.responses.index") %>
    </h1>
  </div>

  <div class="meeting-polls" id="meeting-poll" data-decidim-meetings-poll='{"questionsUrl":"<%= meeting_polls_questions_path(meeting) %>"}'>
    <%= render partial: "decidim/meetings/polls/questions/index" %>
  </div>
<% end %>
